import request from '@/utils/request'

// 查询质量检验标准列表
export function listStandard(query) {
  return request({
    url: '/quality/standard/list',
    method: 'get',
    params: query
  })
}

// 查询质量检验标准详细
export function getStandard(standardId) {
  return request({
    url: '/quality/standard/' + standardId,
    method: 'get'
  })
}

// 新增质量检验标准
export function addStandard(data) {
  return request({
    url: '/quality/standard',
    method: 'post',
    data: data
  })
}

// 修改质量检验标准
export function updateStandard(data) {
  return request({
    url: '/quality/standard',
    method: 'put',
    data: data
  })
}

// 删除质量检验标准
export function delStandard(standardId) {
  return request({
    url: '/quality/standard/' + standardId,
    method: 'delete'
  })
}

// 校验标准编码是否唯一
export function checkStandardCodeUnique(standardCode, standardId) {
  return request({
    url: '/quality/standard/checkStandardCodeUnique',
    method: 'get',
    params: { 
      standardCode: standardCode,
      standardId: standardId
    }
  })
}